class Source < ActiveRecord::Base
  has_many :bookmarks

  def title
    unless desc.blank?
      return desc
    end
    if bookmarks.length > 0
      desc = bookmarks[0].title
      #save
      return desc
    end
    uri
  end

  def tag_list
    taglist = []
    bookmarks.map {|bm| taglist << bm.tag_counts}
    taglist = taglist.uniq
    taglist.join(", ")
  end

  
end
